package gui.data.D2;

import gui.MyFrame;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;

import calcs.PolygonCalculator;

public class PolygonOutputGui extends JPanel{

	JTextField cornersInput, areaInput, sideInput, circumferenceInput, apothemInput, radiusInput;
	MyFrame myFrame;
	JLabel cornersLbl, areaLbl, sideLbl, circumferenceLbl, apothemLbl, radiusLbl;

	public PolygonOutputGui(double corners, double side,
			double apothem, double radius, double circumference, double area) {
		this.setLayout(new GridLayout(0, 2));
		this.setPreferredSize(new Dimension(500, 500));
			
		cornersLbl = new JLabel("Number of corners = ");
		areaLbl = new JLabel("Area = ");
		sideLbl = new JLabel("Side length = ");
		circumferenceLbl = new JLabel("Circumference = ");
		apothemLbl = new JLabel("Apothem = ");
		radiusLbl = new JLabel("Radius = ");
		
		cornersInput = new JTextField(corners == 0 ? "N/A" : "" + corners);
		areaInput = new JTextField(area == 0 ? "N/A" : "" + area);
		sideInput = new JTextField(side == 0 ? "N/A" : "" + side);
		circumferenceInput = new JTextField(circumference == 0 ? "N/A" : "" + circumference);
		apothemInput = new JTextField(apothem == 0 ? "N/A" : "" + apothem);
		radiusInput = new JTextField(radius == 0 ? "N/A" : "" + radius);
		
		cornersInput.setEditable(false);
		areaInput.setEditable(false);
		sideInput.setEditable(false);
		circumferenceInput.setEditable(false);
		apothemInput.setEditable(false);
		radiusInput.setEditable(false);
		
		this.add(cornersLbl);
		this.add(cornersInput);
		this.add(sideLbl);
		this.add(sideInput);
		this.add(apothemLbl);
		this.add(apothemInput);
		this.add(circumferenceLbl);
		this.add(circumferenceInput);
		this.add(areaLbl);
		this.add(areaInput);
		this.add(radiusLbl);
		this.add(radiusInput);
		this.add(new JLabel(""));
	}
}
